<%@ page language="java" contentType="text/html; charset=UTF-8"
		 pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@page import="java.text.SimpleDateFormat" %>
<%@page import="java.text.DateFormat" %>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>



<%
	request.setCharacterEncoding("UTF-8");
	String htmlData = request.getParameter("content1") != null ? request.getParameter("content1") : "";
%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%
	SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ include file="/WEB-INF/JSP/backHome/modalWindows/StudentsListPageAsTimingCharge.jsp"%>
<%@ include file="/WEB-INF/JSP/backHome/modalWindows/argeeCommon.jsp" %>
<%@ include file="/WEB-INF/JSP/backHome/modalWindows/againstAuditCommon.jsp" %>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title>Insert title here</title>
	<script type="text/javascript" src="<%=path%>/My97DatePicker/WdatePicker.js"></script>
	<link rel="stylesheet" type="text/css" href="<%=path%>/CSS/backLayout.css">
	<link rel="stylesheet" type="text/css" href="<%=path%>/CSS/bombBox.css">
	<script type="text/javascript" src="<%=path%>/JQuery/jquery-1.8.2.js"></script>
	<%@ include file="/WEB-INF/JSP/ajax.jsp"%>
</head>
<style>
	select{width: 234px;height: 31px}
	.gn_name{padding-top: 5px}
	.div_zilei{width: 100%;height: 30px}
	.tr{height:40px;background: #57a0ff;font-weight: 700}
	.tr td{font-size: 14px;color: #ffffff}
	.tr_td{height: 40px;}
	.tr_td td{border-bottom: 1px solid #ededed;text-align: center;}
	tr td:nth-child(1) {font-size: 14px;color: #cccccc}
	.date{border: 0;background: #ffffff;text-align: center;}
	.tr_td td:nth-child(1){border-left: 1px solid #cccccc;}
	.tr_td td:nth-child(3){border-right: 1px solid #cccccc;}
	.addTable.deleteTable:HOVER{cursor:pointer;}
	input[type='checkbox']{width: 15px}
	#table1 input{width: 150px}
	#table2 input{width: 150px;}
	.fseq2{border: none;color: #cccccc;text-align: center;}
	.div_input_hang {
		width: 100%;
		height: 40px;
	}
	.input_hang {
		float: left;
		width: 500px;
		height: 40px;
	}
</style>
<body style="background: #f5f5f5;overflow-x: hidden">
<div class="main">
	<div id="modal-overlay">

	</div>
	<c:if test="${empty trainCharge}">
		<div class="weizhi">
			财务管理>>计时收费>>新增
		</div>
	</c:if>
	<c:if test="${not empty trainCharge}">
		<c:if test="${sh == '5'}">
			<div class="weizhi">
				财务管理>>计时收费>>查看
			</div>
		</c:if>
	</c:if>
	<c:if test="${not empty trainCharge}">
		<c:if test="${empty sh}">
			<div class="weizhi">
				财务管理>>计时收费>>修改
			</div>
		</c:if>
	</c:if>
	<!-- 添加 -->
	<div class="div_body" style="box-shadow: 0 0 5px #cccccc;height: 950px">
		<c:if test="${empty trainCharge}">
			<div class="div_form">
				<form action="<%=path%>/DrivingSys/addTimingCharge" class="form" onsubmit="return verify();">
					<div class="div_input_hang">
						<div class="input_hang">
							<span class="gn_name">驾校&nbsp;:&nbsp;</span>
							<input  type="text" name="name"  value="${department.fnameL2}" readonly unselectable="on" style="color: gray;"/>
						</div>
						<div class="input_hang">
							<span class="gn_name">单据编号&nbsp;:&nbsp;</span>
							<input  type="text" name="fnumber" value="${fnumber}" style="color: gray;" readonly unselectable="on"/>
						</div>
						<div class="input_hang">
							<span class="gn_name">业务日期&nbsp;:&nbsp;</span>
							<input  type="text" name="fbizdate"  id="ywrq" value="${date}"
									onclick="WdatePicker({el:'ywrq',dateFmt:'yyyy-MM-dd'})"/>
							<img onclick="WdatePicker({el:'ywrq',dateFmt:'yyyy-MM-dd'})"
								 src="<%=path%>/image/date.jpg"  align="absmiddle" style="padding-left: 15px">
						</div>
					</div>
					<div class="div_input_hang">
						<div class="input_hang">
							<span class="gn_name">摘要&nbsp;:&nbsp;</span>
							<input name="fdescription"/>
						</div>
						<div class="input_hang">
							<span class="gn_name">单据状态&nbsp;:&nbsp;</span>
							<select name="cfbillstate" disabled="disabled">
								<option style="color: gray;">新增</option>
							</select>
						</div>
						<div class="input_hang">
							<span class="gn_name">打印次数&nbsp;:&nbsp;</span>
							<input name="cfdycs" value="0" style="color: gray;" readonly unselectable="on"/>
						</div>
					</div>

					<div class="div_zilei">
						<div style="width: 93%;text-align: right;">
							<img src="<%=path%>/image/insert2323.jpg" class="addTable">
							<span style="padding-right: 20px;color: #57a0ff;font-weight: 700;font-size: 14px" class="addTable">添加</span>
							<img src="<%=path%>/image/delete212.png" class="deleteTable">
							<span class="deleteTable" style="color: #57a0ff;font-weight: 700;font-size: 14px" class="deleteTable">删除</span>
						</div>
					</div>
					<input type="hidden" class="stu">
					<div style="min-height: 500px;width: 88%;padding-left: 90px;position: relative;">
						<div style="overflow:scroll;height: 500px;width: 100%">
							<table  width="100%" align="center" id="table1" style="min-height:50px;border-spacing:0;">
								<tr class="tr">
									<td  width="20px"></td>
									<td  width="30px"></td>
									<td align="center">学员编码</td>
									<td align="center">学员</td>
									<td align="center">性别</td>
									<td align="center">身份证号</td>
									<td align="center">身份证地址</td>
									<td align="center">推荐人</td>
									<td align="center">训练科目</td>
									<td align="center">教练</td>
									<td align="center">练车开始时间</td>
									<td align="center">练车结束时间</td>
									<%--<td align="center">班级</td>
									<td align="center">班级金额</td>--%>
									<td align="center">已收</td>
									<td align="center">应收金额</td>
									<%--<td align="center">规费</td>
									<td align="center">培训费</td>--%>
									<td align="center">现金</td>
									<td align="center">刷卡</td>
									<td align="center">挂账</td>
									<td align="center">银行转账</td>
									<td align="center">实收金额</td>
									<td align="center">优惠金额</td>
									<td align="center">优惠券</td>
									<td align="center">欠费金额</td>
									<td align="center">摘要</td>
								</tr>
							</table>

							<table align="center" id="table2" style="height:50px;overflow:scroll;border-spacing:0;display: none;margin-top: 100px;ma">
								<tr>
									<td><input type="text" readonly unselectable="on" value="合计" class="fseq2" style="width: 55px;"></td>
									<td><input type="text" readonly unselectable="on"></td>
									<td><input type="text" readonly unselectable="on"></td>
									<td><input type="text" readonly unselectable="on"></td>
									<td><input type="text" readonly unselectable="on"></td>
									<td><input type="text" readonly unselectable="on"></td>
									<td><input type="text" readonly unselectable="on"></td>
									<td><input type="text" readonly unselectable="on"></td>
									<td><input type="text" readonly unselectable="on"></td>
									<td><input type="text" readonly unselectable="on"></td>
									<td><input type="text" readonly unselectable="on"></td>
									<td><input type="text" readonly unselectable="on"></td>
									<td><input type="text" readonly unselectable="on"></td>
									<td class="hide"><input type="text" readonly unselectable="on"></td>
									<td	class="hide"><input type="text" readonly unselectable="on"></td>
									<td	class="hide"><input type="text" value="0" readonly unselectable="on" class="gf"><input type="hidden" value="0"></td>
									<td	class="hide"><input type="text" readonly unselectable="on"></td>
									<td><input type="text" value="0" readonly unselectable="on" id="cfcash"></td>
									<td><input type="text" value="0" readonly unselectable="on" id="cfcard"></td>
									<td><input type="text" value="0" readonly unselectable="on" id="cfguazhang"></td>
									<td><input type="text" value="0" readonly unselectable="on" id="cfyhzz"></td>
									<td><input type="text" value="0" readonly unselectable="on" id="cfshje"></td>
									<td><input type="text" value="0" readonly unselectable="on" id="cfyhje"></td>
									<td><input type="text" readonly unselectable="on"></td>
									<td><input type="text" value="0" readonly unselectable="on" id="cfqfje"><input type="hidden" value="0"></td>
									<td><input type="text" readonly unselectable="on"></td>
								</tr>
							</table>
						</div>
					</div>


					<div class="div_input_hang" style="margin-top: 50px">
						<div class="input_hang">
							<span class="gn_name">审核人&nbsp;:&nbsp;</span>
							<input name="fhandlerid" readonly unselectable="on" style="color: gray;" type="text"/>
						</div>
						<div class="input_hang">
							<span class="gn_name">创建者&nbsp;:&nbsp;</span>
							<input name="fcreatorid2" readonly unselectable="on" value="${name}" style="color: gray;" type="text"/>
							<input name="fcreatorid" readonly unselectable="on"  style="color: gray;" type="hidden"/>
						</div>
						<div class="input_hang">
							<span class="gn_name">创建时间&nbsp;:&nbsp;</span>
							<input name="fcreatetime" style="color: gray;" readonly unselectable="on" type="text"/>
						</div>
					</div>

					<div class="div_tj" style="padding-top: 0px;margin-left: 140px;">
						<div>
							<input class="input_submit bc" value="" type="submit" style="margin-top: 0px;margin-right: 30px">
						</div>
						<div>
							<input type="button" class="input_back fh"  value="" onclick="back()" style="margin-top: 0px;"/>
						</div>
					</div>
				</form>
			</div>
		</c:if>

		<!-- 保存 -->
		<c:if test="${trainCharge.cfbillstate == 3}">
			<div class="div_form">
				<form action="<%=path%>/DrivingSys/modifyTimingCharge" class="form"	onsubmit="return verify();">
					<div class="div_input_hang">
						<div class="input_hang">
							<span class="gn_name">驾校&nbsp;:&nbsp;</span>
							<input  type="text" name="name"  value="${department.fnameL2}" readonly unselectable="on" style="color: gray;"/>
						</div>
						<div class="input_hang">
							<span class="gn_name">单据编号&nbsp;:&nbsp;</span>
							<input  type="text" name="fnumber" value="${trainCharge.fnumber}" style="color: gray;" readonly unselectable="on"/>
						</div>
						<div class="input_hang">
							<span class="gn_name">业务日期&nbsp;:&nbsp;</span>
							<input  type="text" name="fbizdate"  id="ywrq" value="${trainCharge.fbizdate}"
									onclick="WdatePicker({el:'ywrq',dateFmt:'yyyy-MM-dd'})"/>
							<img onclick="WdatePicker({el:'ywrq',dateFmt:'yyyy-MM-dd'})"
								 src="<%=path%>/image/date.jpg"  align="absmiddle" style="padding-left: 15px">
						</div>
					</div>
					<div class="div_input_hang">
						<div class="input_hang">
							<span class="gn_name">摘要&nbsp;:&nbsp;</span>
							<input name="fdescription" value="${trainCharge.fdescription}"/>
							<input type="hidden" name="fid" value="${trainCharge.fid}" class="fid"/>
						</div>
						<div class="input_hang">
							<span class="gn_name">单据状态&nbsp;:&nbsp;</span>
							<select name="cfbillstate" disabled="disabled">
								<option style="color: gray;">保存</option>
							</select>
						</div>
						<div class="input_hang">
							<span class="gn_name">打印次数&nbsp;:&nbsp;</span>
							<input name="cfdycs" value="${trainCharge.cfdycs}" style="color: gray;" readonly unselectable="on"/>
						</div>
					</div>

					<div class="div_zilei">
						<div style="width: 93%;text-align: right;">
							<img src="<%=path%>/image/insert2323.jpg" class="addTable">
							<span style="padding-right: 20px;color: #57a0ff;font-weight: 700;font-size: 14px" class="addTable">添加</span>
							<img src="<%=path%>/image/delete212.png" class="deleteTable">
							<span class="deleteTable" style="color: #57a0ff;font-weight: 700;font-size: 14px" class="deleteTable">删除</span>
						</div>
					</div>
					<input type="hidden" class="stu">
					<div style="min-height: 500px;width: 88%;padding-left: 90px;position: relative;">
						<div style="overflow:scroll;height: 500px;width: 100%">
							<table  width="100%" align="center" id="table1" style="min-height:50px;border-spacing:0;">
								<tr class="tr">
									<td  width="20px"></td>
									<td  width="30px"></td>
									<td align="center">学员编码</td>
									<td align="center">学员</td>
									<td align="center">性别</td>
									<td align="center">身份证号</td>
									<td align="center">身份证地址</td>
									<td align="center">推荐人</td>
									<td align="center">训练科目</td>
									<td align="center">教练</td>
									<td align="center">练车开始时间</td>
									<td align="center">练车结束时间</td>
									<%--<td align="center">班级</td>
									<td align="center">班级金额</td>--%>
									<td align="center">已收</td>
									<td align="center">应收金额</td>
									<%--<td align="center">规费</td>
									<td align="center">培训费</td>--%>
									<td align="center">现金</td>
									<td align="center">刷卡</td>
									<td align="center">挂账</td>
									<td align="center">银行转账</td>
									<td align="center">实收金额</td>
									<td align="center">优惠金额</td>
									<td align="center">优惠券</td>
									<td align="center">欠费金额</td>
									<td align="center">摘要</td>
								</tr>
								<c:forEach items="${timingChargeEntries}" var="timingChargeEntries">
									<tr style="margin-top: 45px" id="xy${timingChargeEntries.fseq}">
										<td width="20px"><input type="checkbox" name="check" style="width: 15px"></td>
										<td>
											<input type="text" readonly unselectable="on" class="fseq2" value="${timingChargeEntries.fseq}" style="width: 40px">
											<input type="hidden" name="fseq" class="fseq" value="${timingChargeEntries.fseq}">
										</td>
										<td>
											<input type="text" value="${timingChargeEntries.cfstudentno}" readonly unselectable="on" class="cfstudentno" name="cfstudentno" />
											<input type="hidden" name="cfstudentid" value="${timingChargeEntries.cfstudentid}">
										</td>
										<td>
											<input type="text" value="${timingChargeEntries.studentName}" name="studentName"  class="studentName is_click_ne" onclick="selSrtdent($(this))"/>
											<input type="hidden" name="" value="${timingChargeEntries.cfstudentid}">
										</td>
										<td>
											<c:if test="${timingChargeEntries.cfsex == '1'}">
												<input type="text" readonly unselectable="on" value="男" name="cfsex2" class="cfsex"/>
												<input type="hidden"value="1" name="cfsex"/>
											</c:if>
											<c:if test="${timingChargeEntries.cfsex == '2'}">
												<input type="text" readonly unselectable="on" value="女" name="cfsex2" class="cfsex"/>
												<input type="hidden"value="2" name="cfsex"/>
											</c:if>
											<c:if test="${empty timingChargeEntries.cfsex}">
												<input type="text" readonly unselectable="on" value="女" name="cfsex2" class="cfsex"/>
												<input type="hidden"value="2" name="cfsex"/>
											</c:if>
										</td>
										<td>
											<input type="text" readonly unselectable="on" value="${timingChargeEntries.cfidcardno}" name="cfidcardno" class="cfidcardno"/>
										</td>
										<td>
											<input type="text" readonly unselectable="on" value="${timingChargeEntries.cfidcardaddress}" name="cfidcardaddress" class="cfidcardaddress"/>
										</td>
										<td>
											<input type="text" readonly unselectable="on" value="${timingChargeEntries.cftjr}" name="cftjr" class="cftjr"/>
										</td>
										<td>
											<c:if test="${timingChargeEntries.cfsubject == '2'}">
												<input type="text" readonly unselectable="on" value="科目二" name="cfsubject" class="cfsubject"/>
											</c:if>
											<c:if test="${timingChargeEntries.cfsubject == '3'}">
												<input type="text" readonly unselectable="on" value="科目三" name="cfsubject" class="cfsubject"/>
											</c:if>
										</td>

										<td>
											<input type="text" readonly unselectable="on" value="${timingChargeEntries.cfcoachname}" name="cfcoachname" class="cfcoachname"/>
										</td>
										<td>
											<input type="text" readonly unselectable="on" value="${timingChargeEntries.cfbegintime}" name="cfbegintime" class="cfbegintime"/>
										</td>
										<td>
											<input type="text" readonly unselectable="on" value="${timingChargeEntries.cfendtime}" name="cfendtime" class="cfendtime"/>
										</td>
										<td	class="hide">
											<input type="text" readonly unselectable="on" value="${timingChargeEntries.cfclazz}" name="cfclazz" class="cfclazz"/>
										</td>
										<td	class="hide">
											<input type="text" readonly unselectable="on" value="${timingChargeEntries.cfclazzamount}" name="cfclazzamount" class="cfclazzamount"/>
										</td>
										<td>
											<input type="text" readonly unselectable="on" value="${timingChargeEntries.cfyishou}" name="cfyishou" class="cfyishou"/>
										</td>
										<td>
											<input type="text" readonly unselectable="on" value="${timingChargeEntries.cfysje}" name="cfysje" class="cfysje"/>
										</td>
										<td	class="hide">
											<input type="text" readonly unselectable="on" value="${timingChargeEntries.cfguifei}" name="cfguifei" class="cfguifei"/>
										</td>
										<td	class="hide">
											<input type="text" readonly unselectable="on" value="${timingChargeEntries.cfpxf}" name="cfpxf" class="cfpxf"/>
										</td>
										<td>
											<input type="text" value="${timingChargeEntries.cfcash}"  name="cfcash" class="cfcash" onblur="cfcash2($(this))"/>
											<input type="hidden" value="${timingChargeEntries.cfcash}">
										</td>
										<td>
											<input type="text" value="${timingChargeEntries.cfcard}"  name="cfcard" class="cfcard" onblur="cfcard2($(this))"/>
											<input type="hidden" value="${timingChargeEntries.cfcard}">
										</td>
										<td>
											<input type="text" value="${timingChargeEntries.cfguazhang}"  name="cfguazhang" class="cfguazhang" onblur="cfguazhang2($(this))"/>
											<input type="hidden" value="${timingChargeEntries.cfguazhang}">
										</td>
										<td>
											<input type="text" value="${timingChargeEntries.cfyhzz}"  name="cfyhzz" class="cfyhzz" onblur="cfyhzz2($(this))"/>
											<input type="hidden" value="${timingChargeEntries.cfyhzz}">
										</td>
										<td>
											<input type="text" readonly unselectable="on" value="${timingChargeEntries.cfshje}" name="cfshje" class="cfshje"/>
										</td>
										<td>
											<input type="text" value="${timingChargeEntries.cfyhje}"  name="cfyhje" class="cfyhje" onblur="cfyhje2($(this))"/>
											<input type="hidden" value="${timingChargeEntries.cfyhje}">
										</td>
										<td>
											<input type="text" value="${timingChargeEntries.cfyhj}"  name="cfyhj" class="cfyhj"  onblur="cfyhj2($(this))"/>
											<input type="hidden" value="${timingChargeEntries.cfyhj}">
										</td>
										<td>
											<input type="text" readonly unselectable="on" value="${timingChargeEntries.cfysje-timingChargeEntries.cfshje}" name="cfqfje" class="cfqfje"/>
										</td>
										<td>
											<input type="text" value="${timingChargeEntries.cfremark}" name="cfremark" class="cfremark"/>
										</td>
									</tr>
								</c:forEach>
							</table>

							<table align="center" id="table2" style="height:50px;overflow:scroll;border-spacing:0;margin-top: 100px;">
								<tr>
									<td><input type="text" readonly unselectable="on" value="合计" class="fseq2" style="width: 55px;"></td>
									<td><input type="text" readonly unselectable="on"></td>
									<td><input type="text" readonly unselectable="on"></td>
									<td><input type="text" readonly unselectable="on"></td>
									<td><input type="text" readonly unselectable="on"></td>
									<td><input type="text" readonly unselectable="on"></td>
									<td><input type="text" readonly unselectable="on"></td>
									<td><input type="text" readonly unselectable="on"></td>
									<td><input type="text" readonly unselectable="on"></td>
									<td><input type="text" readonly unselectable="on"></td>
									<td><input type="text" readonly unselectable="on"></td>
									<td><input type="text" readonly unselectable="on"></td>
									<td><input type="text" readonly unselectable="on"></td>
									<td	class="hide"><input type="text" readonly unselectable="on"></td>
									<td	class="hide"><input type="text" readonly unselectable="on"></td>
									<td	class="hide"><input type="text" value="0" readonly unselectable="on" class="gf"><input type="hidden" value="0"></td>
									<td	class="hide"><input type="text" readonly unselectable="on"></td>
									<td><input type="text" value="0" readonly unselectable="on" id="cfcash"></td>
									<td><input type="text" value="0" readonly unselectable="on" id="cfcard"></td>
									<td><input type="text" value="0" readonly unselectable="on" id="cfguazhang"></td>
									<td><input type="text" value="0" readonly unselectable="on" id="cfyhzz"></td>
									<td><input type="text" value="0" readonly unselectable="on" id="cfshje"></td>
									<td><input type="text" value="0" readonly unselectable="on" id="cfyhje"></td>
									<td><input type="text" readonly unselectable="on"></td>
									<td><input type="text" value="0" readonly unselectable="on" id="cfqfje"><input type="hidden" value="0"></td>
									<td><input type="text" readonly unselectable="on"></td>
								</tr>
							</table>
						</div>
					</div>


					<div class="div_input_hang" style="margin-top: 50px">
						<div class="input_hang">
							<span class="gn_name">审核人&nbsp;:&nbsp;</span>
							<input name="fhandlerid" readonly unselectable="on" style="color: gray;" type="text"
								   value="${trainCharge.shName}"/>
						</div>
						<div class="input_hang">
							<span class="gn_name">创建者&nbsp;:&nbsp;</span>
							<input name="fcreatorid2" readonly unselectable="on" value="${trainCharge.createName}" style="color: gray;" type="text"/>
						</div>
						<div class="input_hang">
							<span class="gn_name">创建时间&nbsp;:&nbsp;</span>
							<input name="fcreatetime" style="color: gray;" readonly unselectable="on" type="text" value="${trainCharge.fcreatetime}"/>
						</div>
					</div>

					<div class="div_tj" style="padding-top: 0px">
						<shiro:hasPermission name="/modifyTimingCharge">
							<div>
								<input  class="input_submit bc" value="" type="submit">
							</div>
						</shiro:hasPermission>
						<shiro:hasPermission name="/startProcessTimingCharge">
						<div style="padding-right: 50px">
							<input type="button" class="input_submit tj"   id="sh" onclick="auditProcess(1)"/>
							<input type="hidden" value="1">
						</div>
						</shiro:hasPermission>
						<div>
							<input type="button" class="input_submit cklc"
								   onclick="lookActivitiImg('publicProcess','${trainCharge.fnumber}')"/>
						</div>
						<div>
							<input type="button" class="input_back fh"  onclick="back()"/>
						</div>
					</div>
				</form>
			</div>
		</c:if>

		<!-- 提交 -->
		<c:if test="${trainCharge.cfbillstate == 4}">
			<div class="div_form">
				<form action="<%=path%>/DrivingSys/modifyTimingCharge" class="form">
					<div class="div_input_hang">
						<div class="input_hang">
							<span class="gn_name">驾校&nbsp;:&nbsp;</span>
							<input  type="text" name="name"  value="${department.fnameL2}" readonly unselectable="on" style="color: gray;"/>
						</div>
						<div class="input_hang">
							<span class="gn_name">单据编号&nbsp;:&nbsp;</span>
							<input  type="text" name="fnumber" value="${trainCharge.fnumber}" style="color: gray;" readonly unselectable="on"/>
						</div>
						<div class="input_hang">
							<span class="gn_name">业务日期&nbsp;:&nbsp;</span>
							<input  type="text" name="fbizdate"  id="ywrq" value="${trainCharge.fbizdate}" readonly unselectable="on"/>
							<img src="<%=path%>/image/date.jpg"  style="padding-left: 15px">
						</div>
					</div>
					<div class="div_input_hang">
						<div class="input_hang">
							<span class="gn_name">摘要&nbsp;:&nbsp;</span>
							<input name="fdescription" value="${trainCharge.fdescription}" readonly unselectable="on"/>
							<input type="hidden" name="fid" value="${trainCharge.fid}" class="fid"/>
						</div>
						<div class="input_hang">
							<span class="gn_name">单据状态&nbsp;:&nbsp;</span>
							<select name="cfbillstate" disabled="disabled">
								<option style="color: gray;">审核</option>
							</select>
						</div>
						<div class="input_hang">
							<span class="gn_name">打印次数&nbsp;:&nbsp;</span>
							<input name="cfdycs" value="${trainCharge.cfdycs}" style="color: gray;" readonly unselectable="on"/>
						</div>
					</div>

					<%--<div class="div_zilei">
						<div style="width: 88%;text-align: right;">
							<img src="<%=path%>/image/insert2323.jpg">
							<span style="padding-right: 20px;color: #a9bbe0;font-size: 14px; display:none">添加</span>
							<img src="<%=path%>/image/delete212.png">
							<span class="deleteTable" style="color: #a9bbe0;font-size: 14px">删除</span>
						</div>
					</div>--%>
					<input type="hidden" class="stu">
					<div style="min-height: 500px;width: 88%;padding-left: 90px;position: relative;">
						<div style="overflow:scroll;height: 500px;width: 100%">
							<table  width="100%" align="center" id="table2" style="min-height:50px;border-spacing:0;">
								<tr class="tr">
									<td  width="20px"></td>
									<td  width="30px"></td>
									<td align="center">学员编码</td>
									<td align="center">学员</td>
									<td align="center">性别</td>
									<td align="center">身份证号</td>
									<td align="center">身份证地址</td>
									<td align="center">推荐人</td>
									<td align="center">训练科目</td>
									<td align="center">教练</td>
									<td align="center">练车开始时间</td>
									<td align="center">练车结束时间</td>
									<%--<td align="center">班级</td>
									<td align="center">班级金额</td>--%>
									<td align="center">已收</td>
									<td align="center">应收金额</td>
									<%--<td align="center">规费</td>
									<td align="center">培训费</td>--%>
									<td align="center">现金</td>
									<td align="center">刷卡</td>
									<td align="center">挂账</td>
									<td align="center">银行转账</td>
									<td align="center">实收金额</td>
									<td align="center">优惠金额</td>
									<td align="center">优惠券</td>
									<td align="center">欠费金额</td>
									<td align="center">摘要</td>
								</tr>
								<c:forEach items="${timingChargeEntries}" var="timingChargeEntries">
									<tr style="margin-top: 45px" id="xy${timingChargeEntries.fseq}">
										<td width="20px"><input type="checkbox" name="check" style="width: 15px" disabled="disabled"></td>
										<td>
											<input type="text" readonly unselectable="on" class="fseq2" value="${timingChargeEntries.fseq}" style="width: 40px">
											<input type="hidden" name="fseq" class="fseq" value="${timingChargeEntries.fseq}">
										</td>
										<td>
											<input type="text" value="${timingChargeEntries.cfstudentno}" readonly unselectable="on" class="cfstudentno" name="cfstudentno" />
											<input type="hidden" name="cfstudentid" value="${timingChargeEntries.cfstudentid}">
										</td>
										<td>
											<input type="text" value="${timingChargeEntries.studentName}"  name="studentName" class="studentName" readonly unselectable="on"/>
											<input type="hidden" name="" value="${timingChargeEntries.cfstudentid}">
										</td>
										<td>
											<c:if test="${timingChargeEntries.cfsex == '1'}">
												<input type="text" readonly unselectable="on" value="男" name="cfsex2" class="cfsex"/>
												<input type="hidden"value="1" name="cfsex"/>
											</c:if>
											<c:if test="${timingChargeEntries.cfsex == '2'}">
												<input type="text" readonly unselectable="on" value="女" name="cfsex2" class="cfsex"/>
												<input type="hidden"value="2" name="cfsex"/>
											</c:if>
											<c:if test="${empty timingChargeEntries.cfsex}">
												<input type="text" readonly unselectable="on" value="女" name="cfsex2" class="cfsex"/>
												<input type="hidden"value="2" name="cfsex"/>
											</c:if>
										</td>
										<td>
											<input type="text" readonly unselectable="on" value="${timingChargeEntries.cfidcardno}" name="cfidcardno" class="cfidcardno" />
										</td>
										<td>
											<input type="text" readonly unselectable="on" value="${timingChargeEntries.cfidcardaddress}" name="cfidcardaddress" class="cfidcardaddress"/>
										</td>
										<td>
											<input type="text" readonly unselectable="on" value="${timingChargeEntries.cftjr}" name="cftjr" class="cftjr"/>
										</td>
										<td>
											<c:if test="${timingChargeEntries.cfsubject == '2'}">
												<input type="text" readonly unselectable="on" value="科目二" name="cfsubject" class="cfsubject"/>
											</c:if>
											<c:if test="${timingChargeEntries.cfsubject == '3'}">
												<input type="text" readonly unselectable="on" value="科目三" name="cfsubject" class="cfsubject"/>
											</c:if>
										</td>

										<td>
											<input type="text" readonly unselectable="on" value="${timingChargeEntries.cfcoachname}" name="cfcoachname" class="cfcoachname"/>
										</td>
										<td>
											<input type="text" readonly unselectable="on" value="${timingChargeEntries.cfbegintime}" name="cfbegintime" class="cfbegintime"/>
										</td>
										<td>
											<input type="text" readonly unselectable="on" value="${timingChargeEntries.cfendtime}" name="cfendtime" class="cfendtime"/>
										</td>
										<td	class="hide">
											<input type="text" readonly unselectable="on" value="${timingChargeEntries.cfclazz}" name="cfclazz" class="cfclazz"/>
										</td>
										<td	class="hide">
											<input type="text" readonly unselectable="on" value="${timingChargeEntries.cfclazzamount}" name="cfclazzamount" class="cfclazzamount"/>
										</td>
										<td>
											<input type="text" readonly unselectable="on" value="${timingChargeEntries.cfyishou}" name="cfyishou" class="cfyishou"/>
										</td>
										<td>
											<input type="text" readonly unselectable="on" value="${timingChargeEntries.cfysje}" name="cfysje" class="cfysje"/>
										</td>
										<td	class="hide">
											<input type="text" readonly unselectable="on" value="${timingChargeEntries.cfguifei}" name="cfguifei" class="cfguifei"/>
										</td>
										<td	class="hide">
											<input type="text" readonly unselectable="on" value="${timingChargeEntries.cfpxf}" name="cfpxf" class="cfpxf"/>
										</td>
										<td>
											<input type="text" value="${timingChargeEntries.cfcash}"  name="cfcash" class="cfcash" readonly unselectable="on"/>
											<input type="hidden" value="${timingChargeEntries.cfcash}">
										</td>
										<td>
											<input type="text" value="${timingChargeEntries.cfcard}"  name="cfcard" class="cfcard" readonly unselectable="on"/>
											<input type="hidden" value="${timingChargeEntries.cfcard}">
										</td>
										<td>
											<input type="text" value="${timingChargeEntries.cfguazhang}"  name="cfguazhang" class="cfguazhang" readonly unselectable="on"/>
											<input type="hidden" value="${timingChargeEntries.cfguazhang}">
										</td>
										<td>
											<input type="text" value="${timingChargeEntries.cfyhzz}"  name="cfyhzz" class="cfyhzz" readonly unselectable="on"/>
											<input type="hidden" value="${timingChargeEntries.cfyhzz}">
										</td>
										<td>
											<input type="text" readonly unselectable="on" value="${timingChargeEntries.cfshje}" name="cfshje" class="cfshje"/>
										</td>
										<td>
											<input type="text" value="${timingChargeEntries.cfyhje}" name="cfyhje" class="cfyhje" readonly unselectable="on"/>
											<input type="hidden" value="${timingChargeEntries.cfyhje}">
										</td>
										<td>
											<input type="text" value="${timingChargeEntries.cfyhj}" name="cfyhj" class="cfyhj"  readonly unselectable="on"/>
											<input type="hidden" value="${timingChargeEntries.cfyhj}">
										</td>
										<td>
											<input type="text" readonly unselectable="on" value="${timingChargeEntries.cfysje-timingChargEntries.cfyishou}" name="cfqfje" class="cfqfje"/>
										</td>
										<td>
											<input type="text" value="${timingChargeEntries.cfremark}" name="cfremark" class="cfremark" readonly unselectable="on"/>
										</td>
									</tr>
								</c:forEach>
							</table>

							<table align="center" id="table2" style="height:50px;overflow:scroll;border-spacing:0;margin-top: 100px;">
								<tr>
									<td><input type="text" readonly unselectable="on" value="合计" class="fseq" style="width: 55px"></td>
									<td><input type="text" readonly unselectable="on"></td>
									<td><input type="text" readonly unselectable="on"></td>
									<td><input type="text" readonly unselectable="on"></td>
									<td><input type="text" readonly unselectable="on"></td>
									<td><input type="text" readonly unselectable="on"></td>
									<td><input type="text" readonly unselectable="on"></td>
									<td><input type="text" readonly unselectable="on"></td>
									<td><input type="text" readonly unselectable="on"></td>
									<td><input type="text" readonly unselectable="on"></td>
									<td><input type="text" readonly unselectable="on"></td>
									<td><input type="text" readonly unselectable="on"></td>
									<td><input type="text" readonly unselectable="on"></td>
									<td	class="hide"><input type="text" readonly unselectable="on"></td>
									<td	class="hide"><input type="text" readonly unselectable="on"></td>
									<td	class="hide"><input type="text" value="0" readonly unselectable="on" class="gf"><input type="hidden" value="0"></td>
									<td	class="hide"><input type="text" readonly unselectable="on"></td>
									<td><input type="text" value="0" readonly unselectable="on" id="cfcash"></td>
									<td><input type="text" value="0" readonly unselectable="on" id="cfcard"></td>
									<td><input type="text" value="0" readonly unselectable="on" id="cfguazhang"></td>
									<td><input type="text" value="0" readonly unselectable="on" id="cfyhzz"></td>
									<td><input type="text" value="0" readonly unselectable="on" id="cfshje"></td>
									<td><input type="text" value="0" readonly unselectable="on" id="cfyhje"></td>
									<td><input type="text" readonly unselectable="on"></td>
									<td><input type="text" value="0" readonly unselectable="on" id="cfqfje"><input type="hidden" value="0"></td>
									<td><input type="text" readonly unselectable="on"></td>
								</tr>
							</table>
						</div>
					</div>


					<div class="div_input_hang" style="margin-top: 50px">
						<div class="input_hang">
							<span class="gn_name">审核人&nbsp;:&nbsp;</span>
							<input name="fhandlerid" readonly unselectable="on" style="color: gray;" type="text" value="${trainCharge.shName}"/>
						</div>
						<div class="input_hang">
							<span class="gn_name">创建者&nbsp;:&nbsp;</span>
							<input name="fcreatorid" readonly unselectable="on" value="${trainCharge.createName}" style="color: gray;" type="text"/>
						</div>
						<div class="input_hang">
							<span class="gn_name">创建时间&nbsp;:&nbsp;</span>
							<input name="fcreatetime" style="color: gray;" readonly unselectable="on" type="text" value="${trainCharge.fcreatetime}"/>
						</div>
					</div>

					<div class="div_tj" style="padding-top: 0px">
						<c:if test="${auditState == 'processing'}">
							<shiro:hasPermission name="/auditProcessTimingCharge">
								<div style="padding-right: 50px">
									<input type="button" class="input_submit sh"  id="sh" onclick="auditProcess(2)">
									<input type="hidden" value="2">
								</div>
							</shiro:hasPermission>
						</c:if>
						<shiro:hasPermission name="/failAuditProcessTimingCharge">
							<div style="padding-right: 50px">
								<input type="button" class="input_submit fsh" id="sh" onclick="auditProcess(3)">
								<input type="hidden" value="2">
							</div>
						</shiro:hasPermission>
						<div>
							<input type="button" class="input_submit cklc"
								   onclick="lookActivitiImg('publicProcess','${trainCharge.fnumber}')"/>
						</div>
						<div>
							<input type="button" class="input_back fh" onclick="back()"/>
						</div>
					</div>
				</form>
			</div>
		</c:if>


		<!-- 审核 -->
		<c:if test="${trainCharge.cfbillstate == 5}">
			<div class="div_form">
				<form action="<%=path%>/DrivingSys/modifyTimingCharge" class="form">
					<div class="div_input_hang">
						<div class="input_hang">
							<span class="gn_name">驾校&nbsp;:&nbsp;</span>
							<input  type="text" name="name"  value="${department.fnameL2}" readonly unselectable="on" style="color: gray;"/>
						</div>
						<div class="input_hang">
							<span class="gn_name">单据编号&nbsp;:&nbsp;</span>
							<input  type="text" name="fnumber" value="${trainCharge.fnumber}" style="color: gray;" readonly unselectable="on"/>
						</div>
						<div class="input_hang">
							<span class="gn_name">业务日期&nbsp;:&nbsp;</span>
							<input  type="text" name="fbizdate"  id="ywrq" value="${trainCharge.fbizdate}" readonly unselectable="on"/>
							<img src="<%=path%>/image/date.jpg"  style="padding-left: 15px">
						</div>
					</div>
					<div class="div_input_hang">
						<div class="input_hang">
							<span class="gn_name">摘要&nbsp;:&nbsp;</span>
							<input name="fdescription" value="${trainCharge.fdescription}" readonly unselectable="on"/>
							<input type="hidden" name="fid" value="${trainCharge.fid}" class="fid"/>
						</div>
						<div class="input_hang">
							<span class="gn_name">单据状态&nbsp;:&nbsp;</span>
							<select name="cfbillstate" disabled="disabled">
								<option style="color: gray;">审核</option>
							</select>
						</div>
						<div class="input_hang">
							<span class="gn_name">打印次数&nbsp;:&nbsp;</span>
							<input name="cfdycs" value="${trainCharge.cfdycs}" style="color: gray;" readonly unselectable="on"/>
						</div>
					</div>

					<%--<div class="div_zilei">
						<div style="width: 88%;text-align: right;">
							<img src="<%=path%>/image/insert2323.jpg">
							<span style="padding-right: 20px;color: #a9bbe0;font-size: 14px">添加</span>
							<img src="<%=path%>/image/delete212.png">
							<span class="deleteTable" style="color: #a9bbe0;font-size: 14px">删除</span>
						</div>
					</div>--%>
					<input type="hidden" class="stu">
					<div style="min-height: 500px;width: 88%;padding-left: 90px;position: relative;">
						<div style="overflow:scroll;height: 500px;width: 100%">
							<table  width="100%" align="center" id="table2" style="min-height:50px;border-spacing:0;">
								<tr class="tr">
									<td  width="20px"></td>
									<td  width="30px"></td>
									<td align="center">学员编码</td>
									<td align="center">学员</td>
									<td align="center">性别</td>
									<td align="center">身份证号</td>
									<td align="center">身份证地址</td>
									<td align="center">推荐人</td>
									<td align="center">训练科目</td>
									<td align="center">教练</td>
									<td align="center">练车开始时间</td>
									<td align="center">练车结束时间</td>
									<%--<td align="center">班级</td>
									<td align="center">班级金额</td>--%>
									<td align="center">已收</td>
									<td align="center">应收金额</td>
									<%--<td align="center">规费</td>
									<td align="center">培训费</td>--%>
									<td align="center">现金</td>
									<td align="center">刷卡</td>
									<td align="center">挂账</td>
									<td align="center">银行转账</td>
									<td align="center">实收金额</td>
									<td align="center">优惠金额</td>
									<td align="center">优惠券</td>
									<td align="center">欠费金额</td>
									<td align="center">摘要</td>
								</tr>
								<c:forEach items="${timingChargeEntries}" var="timingChargeEntries">
									<tr style="margin-top: 45px" id="xy${timingChargeEntries.fseq}">
										<td width="20px"><input type="checkbox" name="check" style="width: 15px" disabled="disabled"></td>
										<td>
											<input type="text" readonly unselectable="on" class="fseq2" value="${timingChargeEntries.fseq}" style="width: 40px">
											<input type="hidden" name="fseq" class="fseq" value="${timingChargeEntries.fseq}">
										</td>
										<td>
											<input type="text" value="${timingChargeEntries.cfstudentno}" readonly unselectable="on" class="cfstudentno" name="cfstudentno" />
											<input type="hidden" name="cfstudentid" value="${timingChargeEntries.cfstudentid}">
										</td>
										<td>
											<input type="text" value="${timingChargeEntries.studentName}"  name="studentName" class="studentName" readonly unselectable="on"/>
											<input type="hidden" name="" value="${timingChargeEntries.cfstudentid}">
										</td>
										<td>
											<c:if test="${timingChargeEntries.cfsex == '1'}">
												<input type="text" readonly unselectable="on" value="男" name="cfsex2" class="cfsex"/>
												<input type="hidden"value="1" name="cfsex"/>
											</c:if>
											<c:if test="${timingChargeEntries.cfsex == '2'}">
												<input type="text" readonly unselectable="on" value="女" name="cfsex2" class="cfsex"/>
												<input type="hidden"value="2" name="cfsex"/>
											</c:if>
											<c:if test="${empty timingChargeEntries.cfsex}">
												<input type="text" readonly unselectable="on" value="女" name="cfsex2" class="cfsex"/>
												<input type="hidden"value="2" name="cfsex"/>
											</c:if>
										</td>
										<td>
											<input type="text" readonly unselectable="on" value="${timingChargeEntries.cfidcardno}" name="cfidcardno" class="cfidcardno" />
										</td>
										<td>
											<input type="text" readonly unselectable="on" value="${timingChargeEntries.cfidcardaddress}" name="cfidcardaddress" class="cfidcardaddress"/>
										</td>
										<td>
											<input type="text" readonly unselectable="on" value="${timingChargeEntries.cftjr}" name="cftjr" class="cftjr"/>
										</td>
										<td>
											<c:if test="${timingChargeEntries.cfsubject == '2'}">
												<input type="text" readonly unselectable="on" value="科目二" name="cfsubject" class="cfsubject"/>
											</c:if>
											<c:if test="${timingChargeEntries.cfsubject == '3'}">
												<input type="text" readonly unselectable="on" value="科目三" name="cfsubject" class="cfsubject"/>
											</c:if>
										</td>

										<td>
											<input type="text" readonly unselectable="on" value="${timingChargeEntries.cfcoachname}" name="cfcoachname" class="cfcoachname"/>
										</td>
										<td>
											<input type="text" readonly unselectable="on" value="${timingChargeEntries.cfbegintime}" name="cfbegintime" class="cfbegintime"/>
										</td>
										<td>
											<input type="text" readonly unselectable="on" value="${timingChargeEntries.cfendtime}" name="cfendtime" class="cfendtime"/>
										</td>
										<td	class="hide">
											<input type="text" readonly unselectable="on" value="${timingChargeEntries.cfclazz}" name="cfclazz" class="cfclazz"/>
										</td>
										<td	class="hide">
											<input type="text" readonly unselectable="on" value="${timingChargeEntries.cfclazzamount}" name="cfclazzamount" class="cfclazzamount"/>
										</td>
										<td>
											<input type="text" readonly unselectable="on" value="${timingChargeEntries.cfyishou}" name="cfyishou" class="cfyishou"/>
										</td>
										<td>
											<input type="text" readonly unselectable="on" value="${timingChargeEntries.cfysje}" name="cfysje" class="cfysje"/>
										</td>
										<td	class="hide">
											<input type="text" readonly unselectable="on" value="${timingChargeEntries.cfguifei}" name="cfguifei" class="cfguifei"/>
										</td>
										<td	class="hide">
											<input type="text" readonly unselectable="on" value="${timingChargeEntries.cfpxf}" name="cfpxf" class="cfpxf"/>
										</td>
										<td>
											<input type="text" value="${timingChargeEntries.cfcash}" name="cfcash" class="cfcash" readonly unselectable="on"/>
											<input type="hidden" value="${timingChargeEntries.cfcash}">
										</td>
										<td>
											<input type="text" value="${timingChargeEntries.cfcard}"  name="cfcard" class="cfcard" readonly unselectable="on"/>
											<input type="hidden" value="${timingChargeEntries.cfcard}">
										</td>
										<td>
											<input type="text" value="${timingChargeEntries.cfguazhang}"  name="cfguazhang" class="cfguazhang" readonly unselectable="on"/>
											<input type="hidden" value="${timingChargeEntries.cfguazhang}">
										</td>
										<td>
											<input type="text" value="${timingChargeEntries.cfyhzz}"  name="cfyhzz" class="cfyhzz" readonly unselectable="on"/>
											<input type="hidden" value="${timingChargeEntries.cfyhzz}">
										</td>
										<td>
											<input type="text" readonly unselectable="on" value="${timingChargeEntries.cfshje}" name="cfshje" class="cfshje"/>
										</td>
										<td>
											<input type="text" value="${timingChargeEntries.cfyhje}" name="cfyhje" class="cfyhje" readonly unselectable="on"/>
											<input type="hidden" value="${timingChargeEntries.cfyhje}">
										</td>
										<td>
											<input type="text" value="${timingChargeEntries.cfyhj}" name="cfyhj" class="cfyhj"  readonly unselectable="on"/>
											<input type="hidden" value="${timingChargeEntries.cfyhj}">
										</td>
										<td>
											<input type="text" readonly unselectable="on" value="${timingChargeEntries.cfysje-timingChargEntries.cfyishou}" name="cfqfje" class="cfqfje"/>
										</td>
										<td>
											<input type="text" value="${timingChargeEntries.cfremark}" name="cfremark" class="cfremark" readonly unselectable="on"/>
										</td>
									</tr>
								</c:forEach>
							</table>

							<table align="center" id="table2" style="height:50px;overflow:scroll;border-spacing:0;margin-top: 100px;">
								<tr>
									<td><input type="text" readonly unselectable="on" value="合计" class="fseq" style="width: 55px"></td>
									<td><input type="text" readonly unselectable="on"></td>
									<td><input type="text" readonly unselectable="on"></td>
									<td><input type="text" readonly unselectable="on"></td>
									<td><input type="text" readonly unselectable="on"></td>
									<td><input type="text" readonly unselectable="on"></td>
									<td><input type="text" readonly unselectable="on"></td>
									<td><input type="text" readonly unselectable="on"></td>
									<td><input type="text" readonly unselectable="on"></td>
									<td><input type="text" readonly unselectable="on"></td>
									<td><input type="text" readonly unselectable="on"></td>
									<td><input type="text" readonly unselectable="on"></td>
									<td><input type="text" readonly unselectable="on"></td>
									<td	class="hide"><input type="text" readonly unselectable="on"></td>
									<td	class="hide"><input type="text" readonly unselectable="on"></td>
									<td><input type="text" value="0" readonly unselectable="on" class="gf"><input type="hidden" value="0"></td>
									<td><input type="text" readonly unselectable="on"></td>
									<td><input type="text" value="0" readonly unselectable="on" id="cfcash"></td>
									<td><input type="text" value="0" readonly unselectable="on" id="cfcard"></td>
									<td><input type="text" value="0" readonly unselectable="on" id="cfguazhang"></td>
									<td><input type="text" value="0" readonly unselectable="on" id="cfyhzz"></td>
									<td><input type="text" value="0" readonly unselectable="on" id="cfshje"></td>
									<td><input type="text" value="0" readonly unselectable="on" id="cfyhje"></td>
									<td	class="hide"><input type="text" readonly unselectable="on"></td>
									<td	class="hide"><input type="text" value="0" readonly unselectable="on" id="cfqfje"><input type="hidden" value="0"></td>
									<td><input type="text" readonly unselectable="on"></td>
								</tr>
							</table>
						</div>
					</div>


					<div class="div_input_hang" style="margin-top: 50px">
						<div class="input_hang">
							<span class="gn_name">审核人&nbsp;:&nbsp;</span>
							<input name="fhandlerid" readonly unselectable="on" style="color: gray;" type="text" value="${trainCharge.shName}"/>
						</div>
						<div class="input_hang">
							<span class="gn_name">创建者&nbsp;:&nbsp;</span>
							<input name="fcreatorid" readonly unselectable="on" value="${trainCharge.createName}" style="color: gray;" type="text"/>
						</div>
						<div class="input_hang">
							<span class="gn_name">创建时间&nbsp;:&nbsp;</span>
							<input name="fcreatetime" style="color: gray;" readonly unselectable="on" type="text" value="${trainCharge.fcreatetime}"/>
						</div>
					</div>

					<div class="div_tj" style="padding-top: 0px">
						<shiro:hasPermission name="/failAuditProcessTimingCharge">
							<div style="padding-right: 50px">
								<input type="button" class="input_submit fsh" id="sh" onclick="auditProcess(3)">
								<input type="hidden" value="2">
							</div>
						</shiro:hasPermission>
						<div>
							<input type="button" class="input_submit cklc" value=""
								   onclick="lookActivitiImg('publicProcess','${trainCharge.fnumber}')"/>
						</div>
						<div>
							<input type="button" class="input_back fh" onclick="back()"/>
						</div>
					</div>
				</form>
			</div>
		</c:if>



	</div>
</div>
</body>
<script type="text/javascript" src="<%=path%>/HoganJS/handlebars-v4.0.11.js"></script>
<script type="text/javascript">

    $(document).ready(function(){
        var type = "${type}"
        if(type == 3){
            editAlert();
        }

    })


    //删除一行
    $(".deleteTable").click(function(){
        var tr_len = $("#table1 tr").length;
        if(tr_len == 1){

        }else{
            var s = '';
            $('input:checkbox[name=check]').each(function(i) {
                if($(this).is(':checked')){
                    //减去规费
                    var guifei = $(this).parent().parent().find(".cfguifei").val()
                    var card = ($(".gf").val()*1)-(guifei*1)
                    //保留2位小数点
                    card = decimal(card,2);
                    $(".gf").val(card)
                    $(".gf").next().val(card)

                    //减去现金
                    var cfcash = $(this).parent().parent().find(".cfcash").val()
                    if(cfcash == '' || cfcash == null){

                    }else{
                        var cash = ($("#cfcash").val()*1)-(cfcash*1)
                        //保留2位小数点
                        cash = decimal(cash,2);
                        $("#cfcash").val(cash)
                    }
                    //减去刷卡
                    var cfcard = $(this).parent().parent().find(".cfcard").val()
                    if(cfcard == '' || cfcard == null){

                    }else{
                        var card = ($("#cfcard").val()*1)-(cfcard*1)
                        //保留2位小数点
                        card = decimal(card,2);
                        $("#cfcard").val(card)
                    }
                    //减去挂账
                    var cfguazhang = $(this).parent().parent().find(".cfguazhang").val()
                    if(cfguazhang == '' || cfguazhang == null){

                    }else{
                        var cfguazhang2 = ($("#cfguazhang").val()*1)-(cfguazhang*1)
                        //保留2位小数点
                        cfguazhang2 = decimal(cfguazhang2,2);
                        $("#cfguazhang").val(cfguazhang2)
                    }
                    //减去银行转账
                    var cfyhzz = $(this).parent().parent().find(".cfyhzz").val()
                    if(cfyhzz == '' || cfyhzz == null){

                    }else{
                        var cfyhzz2 = ($("#cfyhzz").val()*1)-(cfyhzz*1);
                        //保留2位小数点
                        cfyhzz2 = decimal(cfyhzz2,2);
                        $("#cfyhzz").val(cfyhzz2)
                    }
                    //减去实收金额
                    var cfshje = $(this).parent().parent().find(".cfshje").val()
                    if(cfshje == '' || cfshje == null){

                    }else{
                        var cfshje2 = ($("#cfshje").val()*1)-(cfshje*1);
                        //保留2位小数点
                        cfshje2 = decimal(cfshje2,2);
                        $("#cfshje").val(cfshje2)
                    }
                    //减去优惠金额
                    var cfyhje = $(this).parent().parent().find(".cfyhje").val()
                    if(cfyhje == '' || cfyhje == null){

                    }else{
                        var cfyhje2 = ($("#cfyhje").val()*1)-(cfyhje*1)
                        //保留2位小数点
                        cfyhje2 = decimal(cfyhje2,2);
                        $("#cfyhje").val(cfyhje2)
                    }
                    //减去欠费金额
                    var cfqfje = $(this).parent().parent().find(".cfqfje").val()
                    if(cfqfje == '' || cfqfje == null){

                    }else{
                        var cfqfje2 = ($("#cfqfje").val()*1)-(cfqfje*1)
                        //保留2位小数点
                        cfqfje2 = decimal(cfqfje2,2);
                        $("#cfqfje").val(cfqfje2)
                        $("#cfqfje").next().val(cfqfje2)
                    }
                    $(this).parent().parent().remove();
                    s = '1';
                }
            })

            if($("#table1 tr").length == 1){
                $("#table2").css('display','none')
            }
            //判断是否选中
            if(s == null || s == ''){
                alert("请选择一条数据删除");
                return false;
            }
            //重新排序
            $('#table1 tr td .fseq').each(function(i) {
                var s = i*1 + 1*1;
                $(this).val(s);
                $(this).prev().val(s)
                $(this).parent().parent().attr("id",'xy'+s);
            })
        }
    })
    //返回
    function back(){
        parent.closeSelectCard()

//        location = 'queryTimingCharge/look.action';
    }

    //开启弹框
    $('.addTable').click(function(){
        $('#modal-overlay').css('visibility','visible')
        $('.modal-data').css('visibility','visible')
        $('input:checkbox').removeAttr('checked');
        $('#index').val(1)
        $('.page').show();
    })

    //由于和input:checkbox冲突，在选择一次
    $("#table1 tr td input:checkbox").live('click',function(){
        if($(this).is(':checked')){
            $(this).removeAttr("checked");
        }else{
            $(this).attr("checked",":checked")
        }
    })
    //单击选中
    $("#table1 tr td").live('click',function(){
        if($(this).parent().find("input:checkbox").is(':checked')){
            $(this).parent().find("input:checkbox").removeAttr("checked");
        }else{
            $(this).parent().find("input:checkbox").attr("checked",":checked")
        }
    })

    $("#table1 input").live('keyup', function(event) {
        var cfremark = $(this).prop("class");
        if(cfremark == 'cfremark'){

        }else{
            //最后一位是小数点的话，移除
            var $amountInput = $(this);
            //响应鼠标事件，允许左右方向键移动
            event = window.event || event;
            if(event.keyCode == 37 | event.keyCode == 39) {
                return;
            }
            var clazz = $(this).prop("class")
            var superclass = $(this).parent().parent().prop("class")
            //获取输入框的值
            var value = $('.'+clazz+'').val();
            //判断负数是否在第一位
            if(value.substring(0,1) == '-'){

            }
            //判断负数不是在第一位，替换
            if(value.lastIndexOf('-') > 0){
                $('#superclass .'+clazz+'').val("")
                // $amountInput.val($amountInput.val().replace('-','')
            }
            //先把非数字的都替换掉，除了数字和.
            $amountInput.val($amountInput.val().replace(/[^\-?\d.]/g, "").
            //只允许一个小数点
            replace(/^\./g, "").replace(/\.{2,}/g, ".").
            //只能输入小数点后两位
            replace(".", "$#$").replace(/\./g, "").replace("$#$", ".").replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3'));
        }
    });

	/* 关闭弹出框    */
    $('.btn').click(function(){
        $('#modal-overlay').css('visibility','hidden')
        $('.modal-data').css('visibility','hidden')
        $('input:checkbox').removeAttr('checked');
        $('.page').hide();
        $(".stu").val("")
    })

    //选择数据
    $('.subtn').click(function () {
        var fseq = $(".stu").val()
        var spCodesTemp = "";
        if(fseq == '' || fseq == null){
            $('input:checkbox[name=student]:checked').each(function (i) {
                if (0 == i) {
                    //把学生id增加到字表中
                    spCodesTemp = $(this).val();

                } else {
                    spCodesTemp += ("," + $(this).val());

                }
            });

            if(spCodesTemp == ""){
                alert("请至少选择一条数据")
                return false
            }
            //判断重复学员
            var a = studentRepetition(null, spCodesTemp)
            if (!a) {
                alert("不能添加重复学员");
                return;
            }
            $.ajax({
                url: '<%=path%>/DrivingSys/selStudentByFidTiming',
                type: "post",
                async: true,
                data: {'id': spCodesTemp},
                dataType: "json",
                success: function (json) {
                    data(json.studentsNameList,fseq)
                },
                error:function(){alert("错误")}
            })
        }else{
            $('input:checkbox[name=student]:checked').each(function(i) {
                if (0 == i) {
                    //把学生id增加到字表中
                    spCodesTemp = $(this).val();
                } else {

                }
            });
            if (spCodesTemp == $("#stuId").val()) {

            } else {
                //判断重复学员
                var a = studentRepetition(null, spCodesTemp)
                if (!a) {
                    alert("不能添加重复学员");
                    return;
                }
            }
            $.ajax({
                url: '<%=path%>/DrivingSys/selStudentByFidTiming',
                type: "post",
                async: true,
                data: {'id': spCodesTemp},
                dataType: "json",
                success:function(json){
                    var studentsNameList = json.studentsNameList[0];
                    data(studentsNameList,fseq)
                },
                error:function(){alert("错误")}
            })
        }
    });

    //双击确定选中数据
    $(document).on('dblclick', '.xysj td', function () {
        var fseq = $(".stu").val()
        var spCodesTemp = "";
        if(fseq == '' || fseq == null){
            spCodesTemp = $(this).parent().find(".td").find("input:checkbox").val();
            var a = studentRepetition(spCodesTemp, null)
            if (!a) {
                alert("不能添加重复学员");
                return;
            }
            $.ajax({
                url: '<%=path%>/DrivingSys/selStudentByFidTiming',
                type: "post",
                async: true,
                data: {'id': spCodesTemp},
                dataType: "json",
                success: function (json) {
                    data(json.studentsNameList,fseq)
                },
                error:function(){alert("错误")}
            })
        }else{
            spCodesTemp = $(this).parent().find(".td").find("input:checkbox").val();
            if (spCodesTemp == $("#stuId").val()) {

            } else {
                var a = studentRepetition(spCodesTemp, null)
                if (!a) {
                    alert("不能添加重复学员");
                    return;
                }
            }
            $.ajax({
                url: '<%=path%>/DrivingSys/selStudentByFidTiming',
                type: "post",
                async: true,
                data: {'id': spCodesTemp},
                dataType: "json",
                success:function(json){
                    var studentsNameList = json.studentsNameList[0];
                    data(studentsNameList,fseq)
                },
                error:function(){alert("错误")}
            })
        }
    })



    //去除重复学员数据
    function studentRepetition(oneStudent, muchStudent) {
        var a = true;
        if (oneStudent == null) {
            var strs = new Array(); //定义一数组
            strs = muchStudent.split(",");//转换成数组
            //循环添加的学员
            for (var i = 0; i < strs.length; i++) {
                //循环现有的学员
                $("input[name='cfstudentid']").each(function (j) {
                    //判断添加的学员不能与现有的学员重复
                    if (strs[i] == $(this).val()) {
                        a = false
                    }
                })
            }
        } else {
            //循环现有的学员
            $("input[name='cfstudentid']").each(function (j) {
                //判断添加的学员不能与现有的学员重复
                if (oneStudent == $(this).val()) {
                    a = false
                }
            })
        }
        return a;
    }


    //写入数据
    function data(studentsNameList,fseq){
        studentRepetition(fseq);
        //规费
        var jsgf = 0;
        //欠费金额
        var qfjine = 0;
        var tr_len = $("#table1 tr").length;//表格长度
        var str = ''
        if(fseq == null || fseq == ''){
            for(var i=0;i<studentsNameList.length;i++) {
                str+='<tr style="margin-top: 45px" id=xy'+(tr_len+i)+'>'
                str+='<td width="20px"><input type="checkbox" name="check" style="width: 15px"></td>'
                str+='<td><input type="text" readonly unselectable="on" class="fseq2" value='+(tr_len+i)+' style="width: 40px"><input type="hidden" name="fseq" class="fseq" value='+(tr_len+i)+'></td>'
                //str+='<input type="text" name="fseq" class="fseq" value='+(tr_len+i)+' readonly unselectable="on" style="width:40px"></td>'
                if(studentsNameList[i].fnumber == null){
                    str+='<td class="zjzdName"><input type="text" readonly unselectable="on" name="cfstudentno" class="cfstudentno"/><input type="hidden" name="cfstudentid" value='+studentsNameList[i].fid+'></td>'
                }else{
                    str+='<td class="zjzdName"><input type="text" value='+studentsNameList[i].fnumber+' readonly unselectable="on" class="cfstudentno" name="cfstudentno" /><input type="hidden" name="cfstudentid" value='+studentsNameList[i].fid+'></td>'
                }
                if(studentsNameList[i].fnameL2 == null){
                    str+='<td class="zjzdName"><input type="text" onclick="selSrtdent($(this))"  name="studentName " class="studentName	is_click_ne"/></td>'
                }else{
                    str+='<td class="zjzdName"><input type="text" value='+studentsNameList[i].fnameL2+'  name="studentName" class="studentName is_click_ne" onclick="selSrtdent($(this))"/></td>'
                }
                if(studentsNameList[i].cfsex == '1'){
                    str+='<td><input type="text" readonly unselectable="on" value="男" name="cfsex2" class="cfsex"/><input type="hidden" value="1" name="cfsex"/></td>'
                }else{
                    str+='<td><input type="text" readonly unselectable="on" value="女" name="cfsex2" class="cfsex"/><input type="hidden"value="2" name="cfsex"/></td>'
                }
                if(studentsNameList[i].cfidcardno == null){
                    str+='<td><input type="text" readonly unselectable="on" name="cfidcardno" class="cfidcardno"/></td>'
                }else{
                    str+='<td><input type="text" readonly unselectable="on" value='+studentsNameList[i].cfidcardno+' name="cfidcardno" class="cfidcardno"/></td>'
                }
                if(studentsNameList[i].cflinkaddress == null){
                    str+='<td><input type="text" readonly unselectable="on" name="cfidcardaddress" class="cfidcardaddress"/></td>'
                }else{
                    str+='<td><input type="text" readonly unselectable="on" value='+studentsNameList[i].cflinkaddress+' name="cfidcardaddress" class="cfidcardaddress"/></td>'
                }
                if(studentsNameList[i].cftjrName == null){
                    str+='<td><input type="text" readonly unselectable="on" name="cftjr" class="cftjr" /></td>'
                }else{
                    str+='<td><input type="text" readonly unselectable="on" value='+studentsNameList[i].cftjrName+' name="cftjr" class="cftjr"/></td>'
                }
                if(studentsNameList[i].cfsubject == null){
                    str+='<td><input type="text" readonly unselectable="on" name="cfsubject" class="cfsubject" /></td>'
                }else{
                    if(studentsNameList[i].cfsubject==2){
                        str+='<td><input type="text" readonly unselectable="on" value="科目二" name="cfsubject" class="cfsubject"/></td>'
                    }else{
                        str+='<td><input type="text" readonly unselectable="on" value="科目三" name="cfsubject" class="cfsubject"/></td>'

                    }

                }
                if(studentsNameList[i].cfcoachname == null){
                    str+='<td><input type="text" readonly unselectable="on" name="cfcoachname" class="cfcoachname" /></td>'
                }else{
                    str+='<td><input type="text" readonly unselectable="on" value='+studentsNameList[i].cfcoachname+' name="cfcoachname" class="cfcoachname"/></td>'
                }
                if(studentsNameList[i].cfbegintime == null){
                    str+='<td><input type="text" readonly unselectable="on" name="cfbegintime" class="cfbegintime" /></td>'
                }else{
                    str+='<td><input type="text" readonly unselectable="on" value="'+studentsNameList[i].cfbegintime+'" name="cfbegintime" class="cfbegintime"/></td>'
                }
                if(studentsNameList[i].cfendtime == null){
                    str+='<td><input type="text" readonly unselectable="on" name="cfendtime" class="cfendtime" /></td>'
                }else{
                    str+='<td><input type="text" readonly unselectable="on" value="'+studentsNameList[i].cfendtime+'" name="cfendtime" class="cfendtime"/></td>'
                }
                if(studentsNameList[i].cfclazzName == null){
                    str+='<td class="hide"><input type="text" readonly unselectable="on" name="cfclazz" class="cfclazz"/></td>'
                }else{
                    str+='<td class="hide"><input type="text" readonly unselectable="on" value='+studentsNameList[i].cfclazzName+' name="cfclazz" class="cfclazz"/></td>'
                }
                if(studentsNameList[i].cfamount == null){
                    str+='<td class="hide"><input type="text" readonly unselectable="on" name="cfclazzamount" class="cfclazzamount"/></td>'
                }else{
                    str+='<td class="hide"><input type="text" readonly unselectable="on" value='+studentsNameList[i].cfamount+' name="cfclazzamount" class="cfclazzamount"/></td>'
                }
                //规费
                var guigei = 0;
                $.ajax({
                    url: '<%=path%>/DrivingSys/selGuiFei',
                    type: "post",
                    async: false,
                    data: {'xzlx': studentsNameList[i].cfslzjcxdh},
                    dataType: "json",
                    success:function(json){
                        guigei = json;
                    },
                    error: function () {
                        alert('Error');
                    }
                })
                if(studentsNameList[i].cfreceived == '0'){
                    str+='<td><input type="text" readonly unselectable="on" value="0" name="cfyishou" class="cfyishou"/></td>'
                    str+='<td><input type="text" readonly unselectable="on" value='+studentsNameList[i].cftimingmoney+' name="cfysje" class="cfysje"/></td>'
                    str+='<td class="hide"><input type="text" readonly unselectable="on" value='+guigei+' name="cfguifei" class="cfguifei"/></td>'
                    var pxf = ((studentsNameList[i].cfamount)*1) - (guigei*1)
                    jsgf = (jsgf*1)+(guigei*1)
                    //保留2位小数点
                    jsgf = decimal(jsgf,2);
                    str+='<td class="hide"><input type="text" readonly unselectable="on" value='+pxf+' name="cfpxf" class="cfpxf"/></td>'
                }else{
                    str+='<td><input type="text" readonly unselectable="on" value='+0+' name="cfyishou" class="cfyishou"/></td>'
                    var ysje = studentsNameList[i].cftimingmoney;
                    //保留2位小数点
                    ysje = decimal(ysje,2);
                    str+='<td><input type="text" readonly unselectable="on" value='+ysje+' name="cfysje" class="cfysje"/></td>'
                    str+='<td class="hide"><input type="text" readonly unselectable="on" value="0" name="cfguifei" class="cfguifei"/></td>'
                    str+='<td class="hide"><input type="text" readonly unselectable="on" value='+ysje+' name="cfpxf" class="cfpxf"/></td>'
                }
                str+='<td><input type="text"  name="cfcash" onblur="cfcash2($(this))" class="cfcash"/><input type="hidden" value="0"/></td>'
                str+='<td><input type="text"  name="cfcard" onblur="cfcard2($(this))" class="cfcard"/><input type="hidden" value="0"/></td>'
                str+='<td><input type="text"  name="cfguazhang" onblur="cfguazhang2($(this))" class="cfguazhang"/><input type="hidden" value="0"/></td>'
                str+='<td><input type="text"  name="cfyhzz" onblur="cfyhzz2($(this))" class="cfyhzz"/><input type="hidden" value="0"/></td>'
                str+='<td><input type="text" readonly unselectable="on" value="0" name="cfshje" class="cfshje" /></td>'
                str+='<td><input type="text"  name="cfyhje"  onblur="cfyhje2($(this))" class="cfyhje"/><input type="hidden" value="0"/></td>'
                str+='<td><input type="text"  name="cfyhj" onblur="cfyhj2($(this))"/><input type="hidden" value="0"/></td>'
                qfjine = (qfjine*1)+((studentsNameList[i].cftimingmoney)*1);
                //保留2位小数点
                qfjine = decimal(qfjine,2);
                str+='<td><input type="text" name="cfqfje" readonly unselectable="on" class="cfqfje" value='+(studentsNameList[i].cftimingmoney)+'></td>'
                str+='<td><input type="text" name="cfremark" class="cfremark"/></td>'
                str+='</tr>'
            }
            //计算规费
            var gfzj = $(".gf").next().val();
            if(gfzj == 0){
                $(".gf").val(jsgf)
                $(".gf").next().val(jsgf)
            }else{
                var result = (gfzj*1)+(jsgf*1);
                //保留2位小数点
                result = decimal(result,2);
                $(".gf").val(result)
                $(".gf").next().val(result)
            }
            //计算欠费金额
            var jq = $("#cfqfje").next().val();
            if(jq == 0){
                $("#cfqfje").val(qfjine);
                $("#cfqfje").next().val(qfjine);
            }else{
               	var cfqfzje = 0;
                $('#table1 tr:gt(0)').each(function () {
                    cfqfzje =  cfqfzje*1+$(this).find("input[name='cfqfje']").val()*1;
                })
				//alert("之前欠费:"+cfqfzje+"----此条欠费:"+qfjine);
                cfqfzje = cfqfzje*1 +(qfjine*1);
                $("#cfqfje").val(cfqfzje);
                $("#cfqfje").next().val(cfqfzje);


                /*var result = (jq*1)+(qfjine*1);
                result = decimal(result,2);
                $("#cfqfje").val(result)
                $("#cfqfje").next().val(result)*/
            }
            $("#table2").show()
            $("#table1").append(str)
            //计算优惠金额
            var youhui = 0;
            $(".cfyhje").each(function(i){
                var s = $(this).val();
                youhui = youhui*1 + s*1
                //保留2位小数点
                youhui = decimal(youhui,2);
            })
            $("#cfyhje").val(youhui);
            $('#modal-overlay').css('visibility', 'hidden')
            $('.modal-data').css('visibility', 'hidden')
        }else{//换人时
            //之前规费
            var sgeifei = $('#xy'+fseq+'').find(".cfguifei").val();
            //之前欠费金额
            var cfqfje = $('#xy'+fseq+'').find(".cfqfje").val();
            //规费
            var guigei = 0;

            $.ajax({
                url: '<%=path%>/DrivingSys/selGuiFei',
                type: "post",
                async: true,
                data: {'xzlx': studentsNameList.cfslzjcxdh},
                dataType: "json",
                success:function(json){
                    guigei = json;
                },
                error: function () {
                    alert('Error');
                }
            })

            if(studentsNameList.fnumber == null){
                $('#xy'+fseq+'').find(".cfstudentno").val("")
                $('#xy'+fseq+'').find(".cfstudentno").next().val(studentsNameList.fid)
            }else{
                $('#xy'+fseq+'').find(".cfstudentno").val(studentsNameList.fnumber)
                $('#xy'+fseq+'').find(".cfstudentno").next().val(studentsNameList.fid)
            }
            if(studentsNameList.fnameL2 == null){
                $('#xy'+fseq+'').find(".studentName").val("")
            }else{
                $('#xy'+fseq+'').find(".studentName").val(studentsNameList.fnameL2)

            }
            if(studentsNameList.cfsex == 1){
                $('#xy'+fseq+'').find(".cfsex").val("男")
                $('#xy'+fseq+'').find(".cfsex").next().val("1")
            }else{
                $('#xy'+fseq+'').find(".cfsex").val("女")
                $('#xy'+fseq+'').find(".cfsex").next().val("2")
            }
            if(studentsNameList.cfidcardno == null){
                $('#xy'+fseq+'').find(".cfidcardno").val("")
            }else{
                $('#xy'+fseq+'').find(".cfidcardno").val(studentsNameList.cfidcardno)
            }
            if(studentsNameList.cflinkaddress == null){
                $('#xy'+fseq+'').find(".cfidcardaddress").val("")
            }else{
                $('#xy'+fseq+'').find(".cfidcardaddress").val(studentsNameList.cflinkaddress)
            }
            if(studentsNameList.cftjrName == null){
                $('#xy'+fseq+'').find(".cftjr").val("")
            }else{
                $('#xy'+fseq+'').find(".cftjr").val(studentsNameList.cftjrName)
            }
            if(studentsNameList.cfsubject == null){
                $('#xy'+fseq+'').find(".cfsubject").val("")
            }else{
                var subjectChange;
                if(studentsNameList.cfsubject==2){
                    subjectChange="科目二";
				}else if(studentsNameList.cfsubject==3){
                    subjectChange="科目三";
				}
                $('#xy'+fseq+'').find(".cfsubject").val(subjectChange)
            }
            if(studentsNameList.cfcoachname == null){
                $('#xy'+fseq+'').find(".cfcoachname").val("")
            }else{
                $('#xy'+fseq+'').find(".cfcoachname").val(studentsNameList.cfcoachname)
            }
            if(studentsNameList.cfbegintime == null){
                $('#xy'+fseq+'').find(".cfbegintime").val("")
            }else{
                $('#xy'+fseq+'').find(".cfbegintime").val(studentsNameList.cfbegintime)
            }
            if(studentsNameList.cfendtime == null){
                $('#xy'+fseq+'').find(".cfendtime").val("")
            }else{
                $('#xy'+fseq+'').find(".cfendtime").val(studentsNameList.cfendtime)
            }
            if(studentsNameList.cfclazzName == null){
                $('#xy'+fseq+'').find(".cfclazz").val("")
            }else{
                $('#xy'+fseq+'').find(".cfclazz").val(studentsNameList.cfclazzName)
            }
            if(studentsNameList.cfamount == null){
                $('#xy'+fseq+'').find(".cfclazzamount").val("")
            }else{
                $('#xy'+fseq+'').find(".cfclazzamount").val(studentsNameList.cfamount)
            }
            if(studentsNameList.cfreceived == '0'){
                $('#xy'+fseq+'').find(".cfyishou").val("0")
                $('#xy'+fseq+'').find(".cfysje").val(studentsNameList.cfamount)
                $('#xy'+fseq+'').find(".cfguifei").val(guigei)
                var pxf = (studentsNameList.cfarrearage - guigei)
                $('#xy'+fseq+'').find(".cfpxf").val(pxf);
				$('#xy'+fseq+'').find('.cfcash').val(0);
                $('#xy'+fseq+'').find('.cfshje').val(0);
            }else{
                $('#xy'+fseq+'').find(".cfyishou").val(studentsNameList.cfreceived)
                var ysje = (studentsNameList.cfamount - studentsNameList.cfreceived)
                $('#xy'+fseq+'').find(".cfysje").val(ysje)
                guigei = 0;
                $('#xy'+fseq+'').find(".cfguifei").val(guigei)
                $('#xy'+fseq+'').find(".cfpxf").val(studentsNameList.cfreceived)
                $('#xy'+fseq+'').find('.cfcash').val(0);
                $('#xy'+fseq+'').find('.cfshje').val(0);
            }
            //清空之前缴费金额
            $('#xy' + fseq + '').find(".cfcash").val("");//现金
            $('#xy' + fseq + '').find(".cfcash").next().val("");
            $('#xy' + fseq + '').find(".cfcard").val("");//刷卡
            $('#xy' + fseq + '').find(".cfcard").next().val("");
            $('#xy' + fseq + '').find(".cfguazhang").val("");//挂账
            $('#xy' + fseq + '').find(".cfguazhang").next().val("");
            $('#xy' + fseq + '').find(".cfyhzz").val("");//银行转账
            $('#xy' + fseq + '').find(".cfyhzz").next().val("");
            $('#xy' + fseq + '').find(".cfshje").val("0");//实收金额
            $('#xy' + fseq + '').find(".cfyhje").val(studentsNameList.cffavorable);//优惠金额
            $('#xy' + fseq + '').find(".cfyhje").next().val(studentsNameList.cffavorable);
            $('#xy' + fseq + '').find(".cfyhj").val("");//优惠券
            $('#xy' + fseq + '').find(".cfyhj").next().val("");
            $('#xy' + fseq + '').find(".cfqfje").val(studentsNameList.cfarrearage);//欠费金额
            $('#xy' + fseq + '').find(".cfqfje").next().val(studentsNameList.cfarrearage);
            allMoney();
            $(".stu").val("");
            $('#modal-overlay').css('visibility', 'hidden')
            $('.modal-data').css('visibility', 'hidden')
            /*var onefjine = (qfjine*1)+((studentsNameList.cfarrearage)*1);
			 //保留2位小数点
			 onefjine = decimal(onefjine,2);
			 $('#xy'+fseq+'').find(".cfqfje").val(onefjine)
			 $('#modal-overlay').css('visibility', 'hidden')
			 $('.modal-data').css('visibility', 'hidden')
			 //利用之前的规费和现在的规费进行判断
			 if(guigei == sgeifei){

			 }else{
			 var gf = $(".gf").val()
			 var gfResulet = (gf*1) - (sgeifei*1) + (guigei*1)
			 //保留2位小数点
			 gfResulet = decimal(gfResulet,2);
			 $(".gf").val(gfResulet)
			 }
			 //利用之前的欠费金额和现在的欠费金额进行判断
			 if(cfqfje == onefjine){

			 }else{
			 var jine = $("#cfqfje").val()
			 var resulet = (jine*1) - (cfqfje*1) + (onefjine*1);
			 //保留2位小数点
			 resulet = decimal(resulet,2);
			 $("#cfqfje").val(resulet)
			 }
			 $(".stu").val("");*/
        }
    }

    //现金计算
    function cfcash2 (_this) {
        //避免最后一个字符串是.
        _this.val((_this.val().replace(/\.$/g, "")));
        if(_this.val() == '-'){
            _this.val("")
        }

        //判断输入错误
        if (isNaN(Number(_this.val()))) {
            _this.val("")
        }

        //现金
        var money = _this.val()
        if(money == ''){
            money = 0;
        }
        //存放之前的值
        var zq =  _this.next().val();
        _this.next().val(money);
        //实收金额
        var ssje = _this.parent().next().next().next().next().find(".cfshje").val();


        //计算实收金额
        var jine = (ssje*1)-(zq*1)+(money*1);
        //保留2位小数点
        jine = decimal(jine,2);
        _this.parent().next().next().next().next().find(".cfshje").val(jine);
        //欠费金额
        var jfje = _this.parent().next().next().next().next().next().next().next().find(".cfqfje").val();
        //计算欠费金额
        var mon = (jfje*1)+(zq*1)-(money*1);
        //保留2位小数点
        mon = decimal(mon,2);
        if (mon < 0) {
            alert("缴费金额大于实收金额");
        }
        _this.parent().next().next().next().next().next().next().next().find(".cfqfje").val(mon);

        //总额
        var ze = $("#cfcash").val();
        //计算总额
        var jine = (ze*1)-(zq*1)+(money*1);
        //保留2位小数点
        jine = decimal(jine,2);
        $("#cfcash").val(jine);

        //实收金额
        var ss = $("#cfshje").val();
        //计算实收总额
        var ssResult = (ss*1)-(zq*1)+(money*1);
        //保留2位小数点
        ssResult = decimal(ssResult,2);
        $("#cfshje").val(ssResult);

        //欠费金额
        var qfjezj = $("#cfqfje").val();
        //计算实收总额
        var ssResult = (qfjezj*1)+(zq*1)-(money*1);
        //保留2位小数点
        ssResult = decimal(ssResult,2);
        $("#cfqfje").val(ssResult);
    }

    //挂账计算
    function cfguazhang2 (_this) {
        //避免最后一个字符串是.
        _this.val((_this.val().replace(/\.$/g, "")));
        if(_this.val() == '-'){
            _this.val("")
        }

        //判断输入错误
        if (isNaN(Number(_this.val()))) {
            _this.val("")
        }

        //现金
        var money = _this.val()
        if(money == ''){
            money = 0;
        }
        //存放之前的值
        var zq =  _this.next().val();
        _this.next().val(money);
        //实收金额
        var ssje = _this.parent().next().next().find(".cfshje").val();
        //计算实收金额
        var jine = (ssje*1) - (zq*1) + (money*1);
        //保留2位小数点
        jine = decimal(jine,2);
        _this.parent().next().next().find(".cfshje").val(jine)
        //欠费金额
        var jfje = _this.parent().next().next().next().next().next().find(".cfqfje").val();
        //计算欠费金额
        var mon = (jfje*1)+(zq*1)-(money*1);
        //保留2位小数点
        mon = decimal(mon,2);
        if (mon < 0) {
            alert("缴费金额大于实收金额");
        }
        _this.parent().next().next().next().next().next().find(".cfqfje").val(mon);

        //总额
        var ze = $("#cfguazhang").val();
        //计算总额
        var jine = (ze*1)-(zq*1)+(money*1);
        //保留2位小数点
        jine = decimal(jine,2);
        $("#cfguazhang").val(jine);

        //实收金额
        var ss = $("#cfshje").val();
        //计算实收总额
        var ssResult = (ss*1)-(zq*1)+(money*1);
        //保留2位小数点
        ssResult = decimal(ssResult,2);
        $("#cfshje").val(ssResult);

        //欠费金额
        var qfjezj = $("#cfqfje").val();
        //计算实收总额
        var ssResult = (qfjezj*1)+(zq*1)-(money*1);
        ssResult = decimal(ssResult,2);
        $("#cfqfje").val(ssResult);
    }

    //银行转账计算
    function cfyhzz2 (_this) {
        //避免最后一个字符串是.
        _this.val((_this.val().replace(/\.$/g, "")));
        if(_this.val() == '-'){
            _this.val("")
        }

        //判断输入错误
        if (isNaN(Number(_this.val()))) {
            _this.val("")
        }

        //现金
        var money = _this.val()
        if(money == ''){
            money = 0;
        }
        //存放之前的值
        var zq =  _this.next().val();
        _this.next().val(money);
        //实收金额
        var ssje = _this.parent().next().find(".cfshje").val();
        //计算实收金额
        var jine = (ssje*1)-(zq*1)+(money*1);
        //保留2位小数点
        jine = decimal(jine,2);
        _this.parent().next().find(".cfshje").val(jine);
        //欠费金额
        var jfje = _this.parent().next().next().next().next().find(".cfqfje").val();
        //计算欠费金额
        var mon = (jfje*1)+(zq*1)-(money*1);
        //保留2位小数点
        mon = decimal(mon,2);
        if (mon < 0) {
            alert("缴费金额大于实收金额");
        }
        _this.parent().next().next().next().next().find(".cfqfje").val(mon);
        //总额
        var ze = $("#cfyhzz").val();
        //计算总额
        var jine = (ze*1)-(zq*1)+(money*1);
        //保留2位小数点
        jine = decimal(jine,2);
        $("#cfyhzz").val(jine);

        //实收金额
        var ss = $("#cfshje").val();
        //计算实收总额
        var ssResult = (ss*1)-(zq*1)+(money*1);
        //保留2位小数点
        ssResult = decimal(ssResult,2);
        $("#cfshje").val(ssResult);

        //欠费金额
        var qfjezj = $("#cfqfje").val();
        //计算实收总额
        var ssResult = (qfjezj*1)+(zq*1)-(money*1);
        //保留2位小数点
        ssResult = decimal(ssResult,2);
        $("#cfqfje").val(ssResult);
    }


    //刷卡计算
    function cfcard2 (_this) {
        //避免最后一个字符串是.
        _this.val((_this.val().replace(/\.$/g, "")));
        if(_this.val() == '-'){
            _this.val("")
        }

        //判断输入错误
        if (isNaN(Number(_this.val()))) {
            _this.val("")
        }

        //现金
        var money = _this.val()
        if(money == ''){
            money = 0;
        }
        //存放之前的值
        var zq =  _this.next().val();
        _this.next().val(money);
        //实收金额
        var ssje = _this.parent().next().next().next().find(".cfshje").val();
        //计算实收金额
        var jine = (ssje*1)-(zq*1)+(money*1);
        //保留2位小数点
        jine = decimal(jine,2);
        _this.parent().next().next().next().find(".cfshje").val(jine);
        //欠费金额
        var jfje = _this.parent().next().next().next().next().next().next().find(".cfqfje").val();
        //计算欠费金额
        var mon = (jfje*1)+(zq*1)-(money*1);
        //保留2位小数点
        mon = decimal(mon,2);
        if (mon < 0) {
            alert("缴费金额大于实收金额");
        }
        _this.parent().next().next().next().next().next().next().find(".cfqfje").val(mon);

        //总额
        var ze = $("#cfcard").val();
        //计算总额
        var jine = (ze*1)-(zq*1)+(money*1);
        //保留2位小数点
        jine = decimal(jine,2);
        $("#cfcard").val(jine);

        //实收金额
        var ss = $("#cfshje").val();
        //计算实收总额
        var ssResult = (ss*1)-(zq*1)+(money*1);
        //保留2位小数点
        ssResult = decimal(ssResult,2);
        $("#cfshje").val(ssResult);

        //欠费金额
        var qfjezj = $("#cfqfje").val();
        //计算实收总额
        var ssResult = (qfjezj*1)+(zq*1)-(money*1);
        //保留2位小数点
        ssResult = decimal(ssResult,2);
        $("#cfqfje").val(ssResult);
    }

    //优惠金额计算
    function cfyhje2 (_this) {
        //避免最后一个字符串是.
        _this.val((_this.val().replace(/\.$/g, "")));
        if(_this.val() == '-'){
            _this.val("")
        }

        //判断输入错误
        if (isNaN(Number(_this.val()))) {
            _this.val("")
        }

        //现金
        var money = _this.val()
        if(money == ''){
            money = 0;
        }
        //存放之前的值
        var zq =  _this.next().val();
        _this.next().val(money);
        //欠费金额
        var jfje = _this.parent().next().next().find(".cfqfje").val();
        //计算欠费金额
        var mon = (jfje*1)+(zq*1)-(money*1);
        //保留2位小数点
        mon = decimal(mon,2);
        if (mon < 0) {
            alert("缴费金额大于实收金额");
        }
        _this.parent().next().next().find(".cfqfje").val(mon);
        //总额
        var ze = $("#cfyhje").val();
        //计算总额
        var jine = (ze*1)-(zq*1)+(money*1);
        //保留2位小数点
        jine = decimal(jine,2);
        $("#cfyhje").val(jine);

        //实收金额
        var ss = $("#cfshje").val();

        //欠费金额
        var qfjezj = $("#cfqfje").val();
        //计算实收总额
        var ssResult = (qfjezj*1)+(zq*1)-(money*1);
        //保留2位小数点
        ssResult = decimal(ssResult,2);
        $("#cfqfje").val(ssResult);
    }

    //优惠券计算
    function cfyhj2 (_this) {
        //避免最后一个字符串是.
        _this.val((_this.val().replace(/\.$/g, "")));
        if(_this.val() == '-'){
            _this.val("")
        }

        //判断输入错误
        if (isNaN(Number(_this.val()))) {
            _this.val("")
        }

        //现金
        var money = _this.val()
        if(money == ''){
            money = 0;
        }
        //存放之前的值
        var zq =  _this.next().val();
        _this.next().val(money);
        //欠费金额
        var jfje = _this.parent().next().find(".cfqfje").val();
        //计算欠费金额
        var mon = (jfje*1)+(zq*1)-(money*1);
        //保留2位小数点
        mon = decimal(mon,2);
        if (mon < 0) {
            alert("缴费金额大于实收金额");
        }
        _this.parent().next().find(".cfqfje").val(mon);
        //欠费金额
        var qfjezj = $("#cfqfje").val();
        //计算实收总额
        var ssResult = (qfjezj*1)+(zq*1)-(money*1);
        //保留2位小数点
        ssResult = decimal(ssResult,2);
        $("#cfqfje").val(ssResult);
    }

    //点击单个学员
    function selSrtdent(_this){
        //获取当前对象序列
        var ss = _this.parent().prev().prev().find(".fseq").val();
        $(".stu").val(ss);
        $('#modal-overlay').css('visibility','visible')
        $('.modal-data').css('visibility','visible')
        $('input:checkbox').removeAttr('checked');
        $('#index').val(1)
        $('.page').show();
    }


    //num是要处理的数字  v为要保留的小数位数
    function decimal(num,v){
        var vv = Math.pow(10,v);
        return Math.round(num*vv)/vv;
    }

    window.onload=function() {
        allMoney();
    }

    function allMoney(){
        //计算规费
        var gf = 0;
        $(".cfguifei").each(function(i){
            var s = $(this).val();
            gf = (gf*1) + (s*1);
            gf = decimal(gf,2);
        })
        $(".gf").val(gf)
        //计算现金
        var cfcash = 0;
        $(".cfcash").each(function(i){
            var s = $(this).val();
            cfcash = (cfcash*1) + (s*1);
            cfcash = decimal(cfcash,2);
        })
        $("#cfcash").val(cfcash)
        //计算刷卡
        var cfcard = 0;
        $(".cfcard").each(function(i){
            var s = $(this).val();
            cfcard = (cfcard*1) + (s*1);
            cfcard = decimal(cfcard,2);
        })
        $("#cfcard").val(cfcard)
        //计算挂账
        var cfguazhang = 0;
        $(".cfguazhang").each(function(i){
            var s = $(this).val();
            cfguazhang = (cfguazhang*1) + (s*1);
            cfguazhang = decimal(cfguazhang,2);
        })
        $("#cfguazhang").val(cfguazhang)
        //计算银行转账
        var cfyhzz = 0;
        $(".cfyhzz").each(function(i){
            var s = $(this).val();
            cfyhzz = (cfyhzz*1) + (s*1);
            cfyhzz = decimal(cfyhzz,2);
        })
        $("#cfyhzz").val(cfyhzz)
        //计算实收金额
        var cfshje = 0;
        $(".cfshje").each(function(i){
            var s = $(this).val();
            cfshje = (cfshje*1) + (s*1);
            cfshje = decimal(cfshje,2);
        })
        $("#cfshje").val(cfshje)
        //计算优惠金额
        var cfyhje = 0;
        $(".cfyhje").each(function(i){
            var s = $(this).val();
            cfyhje = (cfyhje*1) + (s*1);
            cfyhje = decimal(cfyhje,2);
        })
        $("#cfyhje").val(cfyhje)
        //计算欠费金额
        var cfqfje = 0;
        $(".cfqfje").each(function(i){
            var s = $(this).val();
            cfqfje = (cfqfje*1) + (s*1);
            cfqfje = decimal(cfqfje,2);
        })
        $("#cfqfje").val(cfqfje);
        $("#cfqfje").next().val(cfqfje);
	}


    //审核,反审核
    <%--  $("#sh").click(function(){
         var fid = $(".fid").val();
         var type = $(this).next().val();
         $.ajax({
             url: '<%=path%>/DrivingSys/auditTimingCharge',
             type: "post",
             data: {'fid': fid,'type':type},
             dataType: "json",
             success:function(json){
                    if(type == '1'){
                           alert("审核成功")
                       }else{
                           alert("反审核成功")
                       }
                 location = 'queryTimingCharge/look.action';
             }
         })
     }) --%>



    //进行流程
    function auditProcess(state) {
        if(state == 1){//当点击提交时 开启流程并推进流程
            $.messager.confirm('提示','是否提交,提交后不会改变修改后的值',function(r){
                    if (r){
                    //接业务代码
					//改变单据状态
					 $("#fdescriptionL2").val(state);
					 $.ajax({
					 url: '<%=path%>/DrivingSys/startProcessTimingCharge',
					 type: "post",
					 data:{
					 'fnumber':'${trainCharge.fnumber}',
					 'fid':'${trainCharge.fid}',
					 'auditState':'${auditState}'
					 },
					 dataType: "json",
					 success: function (res) {
						 showAlert('提交成功','queryTimingCharge/look.action');
					 },
					 error: function () {
					 	showAlert('提交失败','queryTimingCharge/look.action');
					 }
					 });

               }
           });

        }
        if(state == 2){//当点击为审核时
            $('#modal-overlay').css('visibility','visible');
            $('.modal-data9').css('visibility','visible');
            var message = null;
            $('#auditsubmit').click(function () {
                if($("#agreeAudit").is(":checked")){//同意审核
                    if($('#auditcomment').val()==null||$('#auditcomment').val()==""){
                        message = '同意';
                    }else{
                        message = '同意：'+$('#auditcomment').val();
                    }
                    $.ajax({
                        url: '<%=path%>/DrivingSys/auditProcessTimingCharge',
                        type: "post",
                        dataType: "json",
                        data:{
                            'fnumber':'${trainCharge.fnumber}',
                            'fid':'${trainCharge.fid}',
                            'message':message,
                            'state':1
                        },
                        success: function (res) {
                            if(res==1){
                                showAlert('审核通过','queryTimingCharge/look.action');
                            }else if(res==2){
                                showAlert('审核通过,审核流程已结束','queryTimingCharge/look.action');
                            }else if(res==3){
                                showAlert('当前用户不是经办人没有权限','queryTimingCharge/look.action');
                            }else{
                                showAlert('审核异常,请刷新页面重试','queryTimingCharge/look.action');
                            }

                        },
                        error: function () {
                            alert('Error');
                        }
                    });
                }else if($("#disagreeAudit").is(":checked")){//不同意审核
                    if($('#auditcomment').val()==null||$('#auditcomment').val()==""){
                        message = '不同意';
                    }else{
                        message = '不同意：'+$('#auditcomment').val();
                    }
                    $.ajax({
                        url: '<%=path%>/DrivingSys/auditProcessTimingCharge',
                        type: "post",
                        data:{
                            'fnumber':'${trainCharge.fnumber}',
                            'fid':'${trainCharge.fid}',
                            'message':message,
                            'state':0
                        },
                        dataType: "json",
                        success: function () {
                            showAlert('审核不通过','queryTimingCharge/look.action');
                        },
                        error: function () {
                            showAlert('审核异常,请刷新页面重试','queryTimingCharge/look.action');
                        }
                    });

                }else{
                    alert("请选择是否通过审核!");
                }
            })
        }
        if(state == 3){//当点击为反审核时
            $('#modal-overlay').css('visibility', 'visible')
            $('.modal-data10').css('visibility', 'visible')
            var message = null;
            $('#againstAuditsubmit').click(function () {
                if($('#againstAuditcomment').val()==null||$('#againstAuditcomment').val()==""){
                    message = '反审核';
                }else{
                    message = '反审核：'+$('#againstAuditcomment').val();
                }
                $.ajax({
                    url: '<%=path%>/DrivingSys/failAuditProcessTimingCharge',
                    type: "post",
                    dataType: "json",
                    data:{
                        'fnumber':'${trainCharge.fnumber}',
                        'fid':'${trainCharge.fid}',
                        'message':message,
                        'auditState':'${auditState}'
                    },
                    success: function (res) {
                        showAlert('反审核成功','queryTimingCharge/look.action');
                    },
                    error: function () {
                        showAlert('反审核异常,请刷新页面重试','queryTimingCharge/look.action');
                    }
                });
            });
        }
    }

    //表单验证
    function verify() {
        var s = 0;
        $("input[name='cfstudentid']").each(function () {
            if ($(this).val() == '' || $(this).val() == null) {
            } else {
                s = 1;
                return false;
            }

        })
        var ywrq = $("#ywrq").val();
        if (ywrq == null || ywrq == '') {
            alert("业务日期不能为空");
            return false;
        }
        if (s == 0) {
            alert("请至少添加一条数据");
            return false;
        }
        $("input[type='submit']").attr("disabled", "disabled");


    }
</script>
</html>